<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!-- 引入 layui.css -->
    <link href="https://www.ycxhdn.com/static/template/layui//layui/css/layui.css" rel="stylesheet">
</head>
<body>
<!--<img src="/static/1.jpg" alt="">-->
<input type="file" name="file" id="ID-upload-demo-form-files">
<img src="" width="1000" class="mask" alt="">
<p id="advice"></p>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<!-- 引入 layui.js -->
<script src="https://www.ycxhdn.com/static/template/layui/layui/layui.js"></script>

<script>
layui.use(function(){
  var upload = layui.upload;
  var layer = layui.layer
  // 渲染
  upload.render({
    elem: '#ID-upload-demo-form-files',
    url: '/mask', // 此处配置你自己的上传接口即可
    done: function(res){
      layer.msg('上传成功');
         console.log(res)
         $(".mask").attr("src",res.img)
         $("#advice").text(res.advice)
    }
  });
});
</script>
</body>
</html>